<?php

namespace App\Http\Controllers\Api;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Services\OSS;

class UploadController extends ApiController
{
    public function upload(Request $request)
    {
        $file = $request->file('pic');
//        dd($file);die;
        $pic = uploadFile($file);
        if (!$pic){
            return parent::ajaxReturn(201, new \stdClass(), '图片上传失败');
        }
        return $pic;
    }
}
